package com.aifast.common.desensitize;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author fujian
 * @since 2022/9/9 17:44
 */
public class Desensitizer {

    private static final ThreadLocal<Map<String, String>> context = new ThreadLocal();

    public Desensitizer(){}

    public static Map<String, String> get(){return context.get();}

    public static void set(Map<String, String> map){
        context.set(map);
    }

    public static void remove(){context.remove();}

    /**
     * 跳过pass脱敏操作 需手动调用在方法体里即可
     * <br />
     */
    public static void skip(){
        Map<String, String> map = new HashMap<>(16);
        map.put("skip","yes");
        set(map);
    }


}
